package com.feature.core.util.event;

import org.springframework.transaction.event.TransactionPhase;
import org.springframework.transaction.event.TransactionalEventListener;

public class AfterTransactionListener {

    @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT, classes = AfterTransactionEvent.class)
    public void handle(AfterTransactionEvent event) {
        Runnable runnable = event.getRunnable();
        if (runnable != null) {
            runnable.run();
        }
    }
}
